<?php
global $_W,$_GPC;
$settings = $this->module['config'];
$openid = trim($_GPC["openid"]);
$user = pdo_get($this->modulename . "_user", array("openid" => trim($_GPC["openid"]), "uniacid" => $_W["uniacid"]));
$share = pdo_get($this->modulename . "_ad", array("cateid" => 80, "uniacid" => $_W["uniacid"]));
if(!$share){$share['title'] = $settings['sharetitle'];$share['thumb'] = tomedia($settings['sharethumb']);}
if($settings['system_type'] == 1){
	$unionid = $user['unionid'];
}
if(!$openid){
	exit(json_encode(array('code' => 0, 'status' => 0, 'msg' => '用户信息获取失败')));
}

$condition = "uniacid = {$_W['uniacid']} AND cateid2 = 22 AND is_show = 1";
$orders = " ORDER BY displayorder DESC";
$list = pdo_fetchall("SELECT * FROM ".tablename($this->modulename . "_ad_new")." WHERE ".$condition.$orders);

$i = 0;
if($unionid){
	$user_follow = pdo_fetch("SELECT * FROM " . tablename("mc_mapping_fans") . " WHERE follow = 1 AND unionid = '". $unionid . "' AND uniacid in(SELECT uniacid FROM " . tablename("account_wechats") . ") limit 1");
}
foreach($list as $k=>$v){
	if($v['elmwm_act_id'] == ''){$v['elmwm_act_id'] = 0;}
	if($v['is_ios'] == 1 && $v['elmwm_act_id'] == 0){
		if($user_follow){
			$resArr['waimailist'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'waimaitt_list_bgcolor'=>$v['waimaitt_list_bgcolor'],'waimaitt_list_leftupicon'=>tomedia($v['waimaitt_list_leftupicon']),'waimaitt_list_leftdownicon'=>tomedia($v['waimaitt_list_leftdownicon']),'waimaitt_list_jine'=>$v['waimaitt_list_jine'],'waimaitt_list_jineunit'=>$v['waimaitt_list_jineunit'],'waimaitt_list_jinerighttext'=>$v['waimaitt_list_jinerighttext'],'waimaitt_list_lingqutext'=>$v['waimaitt_list_lingqutext'],'waimaitt_list_lingqucolor'=>$v['waimaitt_list_lingqucolor'],'waimaitt_list_lingqubgcolor'=>$v['waimaitt_list_lingqubgcolor'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 1 && $v['elmwm_act_id'] == 1){
		
		if($user_follow && $user['parent_id'] > 0){
			$resArr['waimailist'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'waimaitt_list_bgcolor'=>$v['waimaitt_list_bgcolor'],'waimaitt_list_leftupicon'=>tomedia($v['waimaitt_list_leftupicon']),'waimaitt_list_leftdownicon'=>tomedia($v['waimaitt_list_leftdownicon']),'waimaitt_list_jine'=>$v['waimaitt_list_jine'],'waimaitt_list_jineunit'=>$v['waimaitt_list_jineunit'],'waimaitt_list_jinerighttext'=>$v['waimaitt_list_jinerighttext'],'waimaitt_list_lingqutext'=>$v['waimaitt_list_lingqutext'],'waimaitt_list_lingqucolor'=>$v['waimaitt_list_lingqucolor'],'waimaitt_list_lingqubgcolor'=>$v['waimaitt_list_lingqubgcolor'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 1 && $v['elmwm_act_id'] == 2){
		
		if($user_follow && $user['parent_id'] == 0){
			$resArr['waimailist'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'waimaitt_list_bgcolor'=>$v['waimaitt_list_bgcolor'],'waimaitt_list_leftupicon'=>tomedia($v['waimaitt_list_leftupicon']),'waimaitt_list_leftdownicon'=>tomedia($v['waimaitt_list_leftdownicon']),'waimaitt_list_jine'=>$v['waimaitt_list_jine'],'waimaitt_list_jineunit'=>$v['waimaitt_list_jineunit'],'waimaitt_list_jinerighttext'=>$v['waimaitt_list_jinerighttext'],'waimaitt_list_lingqutext'=>$v['waimaitt_list_lingqutext'],'waimaitt_list_lingqucolor'=>$v['waimaitt_list_lingqucolor'],'waimaitt_list_lingqubgcolor'=>$v['waimaitt_list_lingqubgcolor'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	if($v['is_ios'] == 2 && $v['elmwm_act_id'] == 0){
		
		if(!$user_follow){
			$resArr['waimailist'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'waimaitt_list_bgcolor'=>$v['waimaitt_list_bgcolor'],'waimaitt_list_leftupicon'=>tomedia($v['waimaitt_list_leftupicon']),'waimaitt_list_leftdownicon'=>tomedia($v['waimaitt_list_leftdownicon']),'waimaitt_list_jine'=>$v['waimaitt_list_jine'],'waimaitt_list_jineunit'=>$v['waimaitt_list_jineunit'],'waimaitt_list_jinerighttext'=>$v['waimaitt_list_jinerighttext'],'waimaitt_list_lingqutext'=>$v['waimaitt_list_lingqutext'],'waimaitt_list_lingqucolor'=>$v['waimaitt_list_lingqucolor'],'waimaitt_list_lingqubgcolor'=>$v['waimaitt_list_lingqubgcolor'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 2 && $v['elmwm_act_id'] == 1){
		
		if(!$user_follow && $user['parent_id'] > 0){
			$resArr['waimailist'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'waimaitt_list_bgcolor'=>$v['waimaitt_list_bgcolor'],'waimaitt_list_leftupicon'=>tomedia($v['waimaitt_list_leftupicon']),'waimaitt_list_leftdownicon'=>tomedia($v['waimaitt_list_leftdownicon']),'waimaitt_list_jine'=>$v['waimaitt_list_jine'],'waimaitt_list_jineunit'=>$v['waimaitt_list_jineunit'],'waimaitt_list_jinerighttext'=>$v['waimaitt_list_jinerighttext'],'waimaitt_list_lingqutext'=>$v['waimaitt_list_lingqutext'],'waimaitt_list_lingqucolor'=>$v['waimaitt_list_lingqucolor'],'waimaitt_list_lingqubgcolor'=>$v['waimaitt_list_lingqubgcolor'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 2 && $v['elmwm_act_id'] == 2){
		
		if(!$user_follow && $user['parent_id'] == 0){
			$resArr['waimailist'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'waimaitt_list_bgcolor'=>$v['waimaitt_list_bgcolor'],'waimaitt_list_leftupicon'=>tomedia($v['waimaitt_list_leftupicon']),'waimaitt_list_leftdownicon'=>tomedia($v['waimaitt_list_leftdownicon']),'waimaitt_list_jine'=>$v['waimaitt_list_jine'],'waimaitt_list_jineunit'=>$v['waimaitt_list_jineunit'],'waimaitt_list_jinerighttext'=>$v['waimaitt_list_jinerighttext'],'waimaitt_list_lingqutext'=>$v['waimaitt_list_lingqutext'],'waimaitt_list_lingqucolor'=>$v['waimaitt_list_lingqucolor'],'waimaitt_list_lingqubgcolor'=>$v['waimaitt_list_lingqubgcolor'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	if($v['is_ios'] == 0 && $v['elmwm_act_id'] == 0){
		$resArr['waimailist'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'waimaitt_list_bgcolor'=>$v['waimaitt_list_bgcolor'],'waimaitt_list_leftupicon'=>tomedia($v['waimaitt_list_leftupicon']),'waimaitt_list_leftdownicon'=>tomedia($v['waimaitt_list_leftdownicon']),'waimaitt_list_jine'=>$v['waimaitt_list_jine'],'waimaitt_list_jineunit'=>$v['waimaitt_list_jineunit'],'waimaitt_list_jinerighttext'=>$v['waimaitt_list_jinerighttext'],'waimaitt_list_lingqutext'=>$v['waimaitt_list_lingqutext'],'waimaitt_list_lingqucolor'=>$v['waimaitt_list_lingqucolor'],'waimaitt_list_lingqubgcolor'=>$v['waimaitt_list_lingqubgcolor'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
		$i++;
	}elseif($v['is_ios'] == 0 && $v['elmwm_act_id'] == 1){
		if($user['parent_id'] > 0){
			$resArr['waimailist'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'waimaitt_list_bgcolor'=>$v['waimaitt_list_bgcolor'],'waimaitt_list_leftupicon'=>tomedia($v['waimaitt_list_leftupicon']),'waimaitt_list_leftdownicon'=>tomedia($v['waimaitt_list_leftdownicon']),'waimaitt_list_jine'=>$v['waimaitt_list_jine'],'waimaitt_list_jineunit'=>$v['waimaitt_list_jineunit'],'waimaitt_list_jinerighttext'=>$v['waimaitt_list_jinerighttext'],'waimaitt_list_lingqutext'=>$v['waimaitt_list_lingqutext'],'waimaitt_list_lingqucolor'=>$v['waimaitt_list_lingqucolor'],'waimaitt_list_lingqubgcolor'=>$v['waimaitt_list_lingqubgcolor'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 0 && $v['elmwm_act_id'] == 2){
		if($user['parent_id'] == 0){
			$resArr['waimailist'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'waimaitt_list_bgcolor'=>$v['waimaitt_list_bgcolor'],'waimaitt_list_leftupicon'=>tomedia($v['waimaitt_list_leftupicon']),'waimaitt_list_leftdownicon'=>tomedia($v['waimaitt_list_leftdownicon']),'waimaitt_list_jine'=>$v['waimaitt_list_jine'],'waimaitt_list_jineunit'=>$v['waimaitt_list_jineunit'],'waimaitt_list_jinerighttext'=>$v['waimaitt_list_jinerighttext'],'waimaitt_list_lingqutext'=>$v['waimaitt_list_lingqutext'],'waimaitt_list_lingqucolor'=>$v['waimaitt_list_lingqucolor'],'waimaitt_list_lingqubgcolor'=>$v['waimaitt_list_lingqubgcolor'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	
}





$condition = "uniacid = {$_W['uniacid']} AND cateid2 = 21 AND is_show = 1";
$orders = " ORDER BY displayorder DESC";
$list = pdo_fetchall("SELECT * FROM ".tablename($this->modulename . "_ad_new")." WHERE ".$condition.$orders);
$daohangwidth = $settings["waimaittnew_daohang_width"];

if($daohangwidth == 150){
	$num = 5;
}else{
	$num = 4;
}


$i = 0;
foreach($list as $k=>$v){
	if($v['elmwm_act_id'] == ''){$v['elmwm_act_id'] = 0;}
	if($v['is_ios'] == 1 && $v['elmwm_act_id'] == 0){
		
		if($user_follow){
			$resArr['waimaidaohang'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 1 && $v['elmwm_act_id'] == 1){
		
		if($user_follow && $user['parent_id'] > 0){
			$resArr['waimaidaohang'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 1 && $v['elmwm_act_id'] == 2){
		
		if($user_follow && $user['parent_id'] == 0){
			$resArr['waimaidaohang'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	if($v['is_ios'] == 2 && $v['elmwm_act_id'] == 0){
		
		if(!$user_follow){
			$resArr['waimaidaohang'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 2 && $v['elmwm_act_id'] == 1){
		
		if(!$user_follow && $user['parent_id'] > 0){
			$resArr['waimaidaohang'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 2 && $v['elmwm_act_id'] == 2){
		
		if(!$user_follow && $user['parent_id'] == 0){
			$resArr['waimaidaohang'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	if($v['is_ios'] == 0 && $v['elmwm_act_id'] == 0){
		$resArr['waimaidaohang'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
		$i++;
	}elseif($v['is_ios'] == 0 && $v['elmwm_act_id'] == 1){
		if($user['parent_id'] > 0){
			$resArr['waimaidaohang'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 0 && $v['elmwm_act_id'] == 2){
		if($user['parent_id'] == 0){
			$resArr['waimaidaohang'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'bgcolor'=>$v['bgcolor'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
}



if(!$settings["waimaittnew_daohang_num"]){$settings["waimaittnew_daohang_num"] =2;}

$resArr['waimaidaohang_list'] = $this->array_split($resArr['waimaidaohang'],$num*$settings["waimaittnew_daohang_num"]);

$condition = "uniacid = {$_W['uniacid']} AND cateid2 = 1 AND is_show = 1";
$orders = " ORDER BY displayorder DESC";
$list = pdo_fetchall("SELECT * FROM ".tablename($this->modulename . "_ad_new")." WHERE ".$condition.$orders);

$i = 0;
foreach($list as $k=>$v){
	if($v['elmwm_act_id'] == ''){$v['elmwm_act_id'] = 0;}
	if($v['is_ios'] == 1 && $v['elmwm_act_id'] == 0){
		
		if($user_follow){
			$resArr['swiperitems'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 1 && $v['elmwm_act_id'] == 1){
		
		if($user_follow && $user['parent_id'] > 0){
			$resArr['swiperitems'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 1 && $v['elmwm_act_id'] == 2){
		
		if($user_follow && $user['parent_id'] == 0){
			$resArr['swiperitems'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	if($v['is_ios'] == 2 && $v['elmwm_act_id'] == 0){
		
		if(!$user_follow){
			$resArr['swiperitems'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 2 && $v['elmwm_act_id'] == 1){
		
		if(!$user_follow && $user['parent_id'] > 0){
			$resArr['swiperitems'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 2 && $v['elmwm_act_id'] == 2){
		
		if(!$user_follow && $user['parent_id'] == 0){
			$resArr['swiperitems'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	if($v['is_ios'] == 0 && $v['elmwm_act_id'] == 0){
		$resArr['swiperitems'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
		$i++;
	}elseif($v['is_ios'] == 0 && $v['elmwm_act_id'] == 1){
		if($user['parent_id'] > 0){
			$resArr['swiperitems'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 0 && $v['elmwm_act_id'] == 2){
		if($user['parent_id'] == 0){
			$resArr['swiperitems'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	
	
}

if(count($resArr['waimaidaohang_list'][0]) <= 5){
	$waimaittnew_daohang_height = $settings['waimaittnew_daohang_height'];
}else{
	$waimaittnew_daohang_height = $settings['waimaittnew_daohang_height']*2;
}


$condition = "uniacid = {$_W['uniacid']} AND cateid2 >= 10001 AND cateid2 <= 10010 ";
$orders = " ORDER BY displayorder DESC";
$list = pdo_fetchall("SELECT * FROM ".tablename($this->modulename . "_ad_new")." WHERE ".$condition.$orders);

$i = 0;
foreach($list as $k=>$v){
	if($v['cateid2'] == 10001){$mall_type = 'jd';}elseif($v['cateid2'] == 10002){$mall_type = 'pdd';}elseif($v['cateid2'] == 10003){$mall_type = 'wph';}elseif($v['cateid2'] == 10004){$mall_type = 'tb';}elseif($v['cateid2'] == 10005){$mall_type = 'youxuan';}
	if($v['elmwm_act_id'] == ''){$v['elmwm_act_id'] = 0;}
	if($v['is_ios'] == 1 && $v['elmwm_act_id'] == 0){
		
		if($user_follow){
			$resArr['mall_nav'][$mall_type][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 1 && $v['elmwm_act_id'] == 1){
		
		if($user_follow && $user['parent_id'] > 0){
			$resArr['mall_nav'][$mall_type][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 1 && $v['elmwm_act_id'] == 2){
		
		if($user_follow && $user['parent_id'] == 0){
			$resArr['mall_nav'][$mall_type][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	if($v['is_ios'] == 2 && $v['elmwm_act_id'] == 0){
		
		if(!$user_follow){
			$resArr['mall_nav'][$mall_type][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 2 && $v['elmwm_act_id'] == 1){
		
		if(!$user_follow && $user['parent_id'] > 0){
			$resArr['mall_nav'][$mall_type][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 2 && $v['elmwm_act_id'] == 2){
		
		if(!$user_follow && $user['parent_id'] == 0){
			$resArr['mall_nav'][$mall_type][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	if($v['is_ios'] == 0 && $v['elmwm_act_id'] == 0){
		$resArr['mall_nav'][$mall_type][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
		$i++;
	}elseif($v['is_ios'] == 0 && $v['elmwm_act_id'] == 1){
		if($user['parent_id'] > 0){
			$resArr['mall_nav'][$mall_type][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 0 && $v['elmwm_act_id'] == 2){
		if($user['parent_id'] == 0){
			$resArr['mall_nav'][$mall_type][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	
	
}

$condition = "uniacid = {$_W['uniacid']} AND cateid2 = 20001 AND is_show = 1 ";
$orders = " ORDER BY displayorder DESC";
$list = pdo_fetchall("SELECT * FROM ".tablename($this->modulename . "_ad_new")." WHERE ".$condition.$orders);

$i = 0;
foreach($list as $k=>$v){
	if($v['elmwm_act_id'] == ''){$v['elmwm_act_id'] = 0;}
	if($v['is_ios'] == 1 && $v['elmwm_act_id'] == 0){
		
		if($user_follow){
			$resArr['ad_banner'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 1 && $v['elmwm_act_id'] == 1){
		
		if($user_follow && $user['parent_id'] > 0){
			$resArr['ad_banner'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 1 && $v['elmwm_act_id'] == 2){
		
		if($user_follow && $user['parent_id'] == 0){
			$resArr['ad_banner'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	if($v['is_ios'] == 2 && $v['elmwm_act_id'] == 0){
		
		if(!$user_follow){
			$resArr['ad_banner'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 2 && $v['elmwm_act_id'] == 1){
		
		if(!$user_follow && $user['parent_id'] > 0){
			$resArr['ad_banner'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 2 && $v['elmwm_act_id'] == 2){
		
		if(!$user_follow && $user['parent_id'] == 0){
			$resArr['ad_banner'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	if($v['is_ios'] == 0 && $v['elmwm_act_id'] == 0){
		$resArr['ad_banner'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
		$i++;
	}elseif($v['is_ios'] == 0 && $v['elmwm_act_id'] == 1){
		if($user['parent_id'] > 0){
			$resArr['ad_banner'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 0 && $v['elmwm_act_id'] == 2){
		if($user['parent_id'] == 0){
			$resArr['ad_banner'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	
	
}

$condition = "uniacid = {$_W['uniacid']} AND cateid2 = 20002 AND is_show = 1 ";
$orders = " ORDER BY displayorder DESC";
$list = pdo_fetchall("SELECT * FROM ".tablename($this->modulename . "_ad_new")." WHERE ".$condition.$orders);

$i = 0;
foreach($list as $k=>$v){
	if($v['elmwm_act_id'] == ''){$v['elmwm_act_id'] = 0;}
	if($v['is_ios'] == 1 && $v['elmwm_act_id'] == 0){
		
		if($user_follow){
			$resArr['ad_banner_list'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 1 && $v['elmwm_act_id'] == 1){
		
		if($user_follow && $user['parent_id'] > 0){
			$resArr['ad_banner_list'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 1 && $v['elmwm_act_id'] == 2){
		
		if($user_follow && $user['parent_id'] == 0){
			$resArr['ad_banner_list'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	if($v['is_ios'] == 2 && $v['elmwm_act_id'] == 0){
		
		if(!$user_follow){
			$resArr['ad_banner_list'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 2 && $v['elmwm_act_id'] == 1){
		
		if(!$user_follow && $user['parent_id'] > 0){
			$resArr['ad_banner_list'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 2 && $v['elmwm_act_id'] == 2){
		
		if(!$user_follow && $user['parent_id'] == 0){
			$resArr['ad_banner_list'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	if($v['is_ios'] == 0 && $v['elmwm_act_id'] == 0){
		$resArr['ad_banner_list'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
		$i++;
	}elseif($v['is_ios'] == 0 && $v['elmwm_act_id'] == 1){
		if($user['parent_id'] > 0){
			$resArr['ad_banner_list'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 0 && $v['elmwm_act_id'] == 2){
		if($user['parent_id'] == 0){
			$resArr['ad_banner_list'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	
	
}

$condition = "uniacid = {$_W['uniacid']} AND cateid2 = 20003 AND is_show = 1 ";
$orders = " ORDER BY displayorder DESC";
$list = pdo_fetchall("SELECT * FROM ".tablename($this->modulename . "_ad_new")." WHERE ".$condition.$orders);
$i = 0;
foreach($list as $k=>$v){
	if($v['elmwm_act_id'] == ''){$v['elmwm_act_id'] = 0;}
	if($v['is_ios'] == 1 && $v['elmwm_act_id'] == 0){
		
		if($user_follow){
			$resArr['ad_banner_list2'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 1 && $v['elmwm_act_id'] == 1){
		
		if($user_follow && $user['parent_id'] > 0){
			$resArr['ad_banner_list2'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 1 && $v['elmwm_act_id'] == 2){
		
		if($user_follow && $user['parent_id'] == 0){
			$resArr['ad_banner_list2'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	if($v['is_ios'] == 2 && $v['elmwm_act_id'] == 0){
		
		if(!$user_follow){
			$resArr['ad_banner_list2'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 2 && $v['elmwm_act_id'] == 1){
		
		if(!$user_follow && $user['parent_id'] > 0){
			$resArr['ad_banner_list2'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 2 && $v['elmwm_act_id'] == 2){
		
		if(!$user_follow && $user['parent_id'] == 0){
			$resArr['ad_banner_list2'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	if($v['is_ios'] == 0 && $v['elmwm_act_id'] == 0){
		$resArr['ad_banner_list2'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
		$i++;
	}elseif($v['is_ios'] == 0 && $v['elmwm_act_id'] == 1){
		if($user['parent_id'] > 0){
			$resArr['ad_banner_list2'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}elseif($v['is_ios'] == 0 && $v['elmwm_act_id'] == 2){
		if($user['parent_id'] == 0){
			$resArr['ad_banner_list2'][$i] = array('item_id'=>$v['id'],'cateid2'=>$v['cateid2'],'is_warm'=>$v['is_warm'],'appid_type2'=>$v['appid_type2'],'meituantype'=>$v['meituantype'],'height'=>$v['height'],'tplid'=>$v['tplid'],'style'=>$v['style'],'width'=>$v['width'],'title'=>$v['title'],'title_text'=>$v['title_text'],'title_desc'=>$v['title_desc'],'img'=>tomedia($v['thumb']),'adtype'=>$v['adtype'],'appid_type'=>$v['appid_type'],'appid'=>$v['appid'],'path'=>$v['path'],'url'=>$v['url'],'opentype'=>'click','h5_url'=>$v['url'],'reply_thumb'=>$v['reply_thumb'],'reply_text'=>$v['reply_text'],'link_title' => $v['link_title'],'link_desc' => $v['link_desc'],'link_thumb' => $v['link_thumb'],'link_url' => $v['link_url'],'is_ios'=>$v['is_ios'],'elmwm_act_id'=>$v['elmwm_act_id'],'mtpic'=>$v['mtpic'],'mall_thumb'=>tomedia($v['mall_thumb']),'pic_style'=>$v['pic_style'],'mall_is_show'=>$v['mall_is_show'],'is_show'=>$v['is_show'],'mall_adtype'=>$v['mall_adtype'],'banner_color'=>$v['banner_color'],'mall_type'=>$v['mall_type'],'open_thumb'=>tomedia($v['open_thumb']));
			$i++;
		}
	}
	
	
}

exit(json_encode(array('code' => 0, 'status' => 1, 'msg' => 'SUCCESS', 'waimaittnew_daohang_height' => $waimaittnew_daohang_height, 'waimailist' => $resArr['waimailist'], 'waimaidaohang' => $resArr['waimaidaohang_list'], 'lunbo' => $resArr['swiperitems'], 'mall_nav' => $resArr['mall_nav'], 'ad_banner' => $resArr['ad_banner'], 'ad_banner_list' => $resArr['ad_banner_list'], 'ad_banner_list2' => $resArr['ad_banner_list2'], 'sharetitle' => $share['title'], 'sharepic' => tomedia($share['thumb']))));